package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Classinfo {
    private Long id;
    private String name;
    private Integer number;
    private Long employee_id;
    private Employee employee;

    public String getJson() {
        HashMap map = new HashMap();
        map.put("id", id);
        map.put("name", name);
        map.put("number", number);
        //将map形式转化为json字符串形式
        map.put("employee", employee);
        return JSON.toJSONString(map);
    }
}